package contracts.emailReset

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method "GET"
        url value(producer("/api/email-reset/users/2")
                , consumer(regex("/api/email-reset/users/\\d+")))
    }
    response {
        status 200
        body("""
            {
                "status":"SUCCESS",
                "email":"734398501@qq.com"
            }
        """)
        bodyMatchers {
            jsonPath('$.status', byType())
            jsonPath('$.email', byRegex(email()))
        }
        headers {
            header("Content-Type", "application/json;charset=UTF-8")
        }
    }
}
